<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /**
         *  var arr = [1,2,3,4];
         *  ==> [2,3,4]
         * 
         *  arr[0] = arr[1]  // [2,2,3,4]
         *  arr[1] = arr[2]  // [2,3,3,4]
         *  arr[2] = arr[3]  // [2,3,4,4]
         * 
         *  arr.length--;   // [2,3,4]
         *  
         * 
         * 
         */

        var arr = [1,2,3,4];
        for(var i = 0; i < arr.length; i++){
            arr[i] = arr[i + 1]
            // i   =  0    arr[0] = arr[1]
            // i =1        arr[1] = arr[2]
            // i = 2       arr[2] = arr[3]
        }

        arr.length--;
        console.log(arr);

    </script>
</body>
</html>